//
//  ComposeTextView.swift
//  XLWB
//
//  Created by 郭亮 on 16/3/19.
//  Copyright © 2016年 gl. All rights reserved.
//

import UIKit

class ComposeTextView: UITextView {
    // MARK:-懒加载属性
    lazy var placeHolderLable: UILabel = UILabel()
    
    // MARK:-系统回调方法
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupChildView()
    }
}

// MARK:-UI界面
extension ComposeTextView {
    private func setupChildView() {
        //添加子控件
        addSubview(placeHolderLable)
        //设置frame
        placeHolderLable.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(10)
            make.top.equalTo(8)
        }
        //设置属性
        placeHolderLable.font = font
        placeHolderLable.text = "分享你的新鲜事..."
        placeHolderLable.textColor = UIColor.lightGrayColor()
        
        textContainerInset = UIEdgeInsetsMake(8, 8, 0, 8)
    }
}
